package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MerchantMenuMapper;
import com.ruoyi.system.domain.MerchantMenu;
import com.ruoyi.system.service.IMerchantMenuService;

/**
 * 商家菜单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-17
 */
@Service
public class MerchantMenuServiceImpl implements IMerchantMenuService 
{
    @Autowired
    private MerchantMenuMapper merchantMenuMapper;

    /**
     * 查询商家菜单
     * 
     * @param id 商家菜单主键
     * @return 商家菜单
     */
    @Override
    public MerchantMenu selectMerchantMenuById(Long id)
    {
        return merchantMenuMapper.selectMerchantMenuById(id);
    }

    /**
     * 查询商家菜单列表
     * 
     * @param merchantMenu 商家菜单
     * @return 商家菜单
     */
    @Override
    public List<MerchantMenu> selectMerchantMenuList(MerchantMenu merchantMenu)
    {
        return merchantMenuMapper.selectMerchantMenuList(merchantMenu);
    }

    /**
     * 新增商家菜单
     * 
     * @param merchantMenu 商家菜单
     * @return 结果
     */
    @Override
    public int insertMerchantMenu(MerchantMenu merchantMenu)
    {
        merchantMenu.setCreateTime(DateUtils.getNowDate());
        return merchantMenuMapper.insertMerchantMenu(merchantMenu);
    }

    /**
     * 修改商家菜单
     * 
     * @param merchantMenu 商家菜单
     * @return 结果
     */
    @Override
    public int updateMerchantMenu(MerchantMenu merchantMenu)
    {
        return merchantMenuMapper.updateMerchantMenu(merchantMenu);
    }

    /**
     * 批量删除商家菜单
     * 
     * @param ids 需要删除的商家菜单主键
     * @return 结果
     */
    @Override
    public int deleteMerchantMenuByIds(Long[] ids)
    {
        return merchantMenuMapper.deleteMerchantMenuByIds(ids);
    }

    /**
     * 删除商家菜单信息
     * 
     * @param id 商家菜单主键
     * @return 结果
     */
    @Override
    public int deleteMerchantMenuById(Long id)
    {
        return merchantMenuMapper.deleteMerchantMenuById(id);
    }

    @Override
    public int deleteMerchantMenu(MerchantMenu merchantMenu) {
        return merchantMenuMapper.deleteMerchantMenu(merchantMenu);
    }
}
